'''【bug】:下面的if a[j] > b[i]可能会越界'''
def method(a, b):
    # 处理
    a.sort()
    b.sort()
    for i in range(len(a)):
        a[i] *= 2 
    # 计数
    count = 0
    j = 0
    for i in range(len(b)):
        if not j < len(a):
            break
        while j < len(a) and a[j] <= b[i]:
            j += 1
        if a[j] > b[i]: 
            j += 1
            count += 1 
    return count 

if __name__ == '__main__':
    n = int(input())
    a = [int(x) for x in input().split(' ')]
    b = [int(x) for x in input().split(' ')]
    count = method(a, b)
    print(count)
